Text windows are multipurpose and can be used for text editing, as a calculator and for scripting, especially script debugging. Text windows offer a superior environment to edit and debug scripts, before the final making of an applet or droplet. (Text windows do not support making applets and droplets ; use a script window for that purpose.)
Getting started with Text windows
• Open a new text window by selecting "New text" ( N, "File" menu).
The new window will be the active (frontmost) window and will be "untitled." It can be moved and sized.
• Smile text windows are white in color. (Script windows have a color depending on the preference setting.)
• A new text window will be a basic window, with no buttons installed. Buttons add functionality and can be added to text windows by dragging. Buttons are discussed elsewhere.
• Each window includes a size box, a vertical scroll bar, a zoom-box, and a close box.
• Smile supports having multiple text windows open at the same time. Each text window "has its own undo". When you make a window active, you can undo the last action performed even if it was performed a long time ago - provided the changes have not been saved.
• Text windows are saved by selecting "Save" or "Save as..." ("File" menu). The saved text window is saved as a "TEXT" file which has the standard Smile test icon. Smile text files can be opened by other text editors and word processors.
• When changes have been made to a text window, and it is saved, its position on the screen and its size are also saved. On reopening, the window will be presented at its previous position, and with its previous size.
Changes refer to the editing of text or the adding of deleting of buttons to the text window. Simply changing the position on the screen or the size of a text window is not considered a change. If you want the window position or size to be remembered, make a trivial change to the text and then "Save" ("File" menu)
• -click the title of any window to open a local pull-down menu which displays its path (if any). Selecting an item of this menu reveals the corresponding folder in the Finder. The "title" is at the center of the top bar of the window. The window must have a title for the pull-down menu to be displayed. (It will not work if the window is "untitled." ) This feature works with text, Worksheet, output and script windows.
Text editing
Smile text windows function similarly to other text editors of which you are likely to be familiar. Text can be edited using the Smile editing tools available from the menus, shortcut keys, mouse and drop-and-drag.
Your newly opened text window has a default line-width setting. This setting establishes the number of characters that fit on one line. The line-width can be set for each window on an individual basis using "Line width...", in the "Text" menu.
Try the following choices from the "Text" menu :
• Font selection.
• Font size
• Styled text
• Colored text
Try the following choices form the "Edit menu" :
• Undo
• Cut
• Paste
• Clear
• Select all
Using drag-and-drop in text windows
Text windows (and all other Smile windows as well) support drag-and-drop which will come to good use during your editing activities.
Use drag-and-drop to perform the following :
• Rearrange text within a given text window.
• Drag text to another window within Smile.
• Make a clipping outside of Smile.
• Drag-and-drop a clipping from outside Smile onto a text window.
• Move a block of selected text to another application using drag-and-drop.
• Drag a block of selected text from another application onto a Smile text window.
• Drag an existing Smile text file onto a text window to open it.
• Drag an existing Smile script file onto a text window to open it.
Drag-and-drop works conventionally within Smile. That is, when selected text is dragged within a given window, the text is "moved" from the original location to the new location. However, when the selected text is dragged from one window to another, it is "copied" to the new location.
• Text windows can be used as a mean to obtain easily some information about various Smile objects. This applies to the dialog items in custom dialogs, and to the buttons in graphic windows.
Dropping such an object onto a text window will insert at the drop location (as string) the record of the properties of the object. It is the same string which can also be obtained as the result of the following script :
----------------------------
theObject as record
----------------------------
assuming that "theObject" contains a reference to the object.
If the Command key () is held down while the object is dropped on a text window, the string inserted in the text will be the (unique, by id number) reference to the object. Such a reference can look like :